package com.example.travelservlet.user.exception;

import com.example.travelservlet.user.domain.Result;
import com.example.travelservlet.utils.ResultUtil;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @author hxy
 * @date 2022/11/4 20:53
 */
@RestControllerAdvice
public class BizExceptionHandler {
    @ExceptionHandler(BizException.class)
    public Result handlerException(BizException e){
        return ResultUtil.error("500",e.getMessage(),null);
    }
}
